Function hasCategory