printf was failing in those calls so i simply removed it, i know this is not a good solution, i'll try to figure out whats going on