Use `monitor_thread.nil?` instead of `monitor_thread == nil`.