add auto generate method