avoid 504 Gateway Timeout issues