Declared paintInterval variable that was causing javascript error on Chrome