Add catch for OSError exception