fix for preflight requests

handle preflight requests