cleaning error checking
debug changes