Update to use props function