optimal location for debug