fixes all multiple returns
author: kpmartin, quan1992