fix empty javascript problem