added navagation and handled errors for adding posts