Changed the way we check for the client, as per Mistaqur's advice