Improved file frame if statement