added protection for slow browsers