malloc the path at the beginning
fix quitting, remove debugging