fixed errors, works fine now