added doOptions as suggested by Huang Yuan to overcome a security issue