improve alert content function