clean code and fix the account missing exception