use return instead of exit in build functions