use return outside of else to fix go1.0.x