bugs fixed warning of returning