finally fixed restarting after mouse disconect/reconect