Replace exit with a return