Added function to check if an appuser already exists.