fixed result type bug
minor changes