add delay function for server