Implemented some control on I/O