Fixed Bugs in the previous version