added lock status to the device draw function