fix ret behavior