Added failure check to device open