fixed the stupid bugs