more fixes in getUsers function

should fix “invalid JSON node” error