modified debug funcitonality