debug and checks