open file check before read