Fixed record javascript running on every page