Fixed bugs. Now it works fine!