adds delay to ajax request