Few critical changes for the script