changing debug system to send message to JavaScript console instead of mess with HTML content