Fixed file descriptor to properly log monitor activity