perror instead of printf for errors