law mode fixed....sql queries updated