bug changed navigator.connection.type to navigator.network.connection.type