nice version of optional cors support