added category_id method to post model