adds debug to necessary places