fix model reading