Opening file and error handling complete