fix security check almost always returning success.