fixed problem where the device freezes