fixed open() bug