Added a method in Post model