implemented active record scopes