Replace exit with return