fixed problem when no connection