update modallayer code