fixed closing the layer after send