Removed else clauses after redirects and added return before redirect() and flash() calls