fixing #39-40 error with exits