moved return statement to the correct place
closes #567