changed to work with headjs