added relationships and named scope