completed the  actions function