bugfix: redirecting back to referer when action is not valid