fixed testing to test if user logged in but not owner of post to edit
cleaned up the code