added debug msg to esms