fixed end in method in posts controller