add sleep time for web service, some modifications