Update function for checking valid file endings