added safeguard for null options