print functions return -1 on error