implement approve function