fixed uninitialzed mode in open()