use @options.protocol instead of @options.protocol.nil? for assignment
remove options.library