Javascript error and settings active icon