I've added the right code into the functions.