fixing some errors, selects still not right