added conditional to edit and destroy methods in post controller