add check on debug