Used return instead of exit and return early