refactor check for length on admin dashboard