moved debug to main