fix model loading bugs