adding logic for empty data if admin param is true