fixed bug that occured on file endpoints