Commented out the closing of the input channel due to possible race condition