fixed bugs (i don't remember what the hell i did...)