Added safety check when selecting row on file open.