add function to models