updsated ajax answer checking code