fix horrible bugs