Add forgotten endfunction