file descriptor error fixed