used flow control instead of exit