Rather than making a server call, which seems to be not working always anyways, use a foolproof method for this.