added method to handle ioctl properly