fixed returning wrong type