Added `exit` statement to correct redirects

Without `exit` word it's not correctly redirected.