Fixed users search errors

Fixes error when the result is empty.