Updated the the code for latest changes