fixing file sorting issues and better error message when ticket expires