Correctly set priority based on file