fixed offline bugs