fixed early exit bug in release build