add layout js to check for policy