fix errors, now it works