Fixed the case when the beforeFilter returned a string and terminated the application before "register"