good for me
use exit instead of return in subfunction