Fixing bug and added some debug print