perror bug fixed