fixed some bugs in atm