Corrects a javascript issue