Bug Fixes

Fixed Some Important Bugs in the script
Foysal Link