Fixed a forgotten end on a function