fixed bugs in open()