You're declaring cashRegister twice. Only the last time will count.