Updated method of Debug and error message