added orm functions