err handling for open command