refined verification for whitespace, added 3 failure exit