Moved post check to view
Fixed global bugg
Refactored the code into the helper-file