send data to function in ctrl