Improvment on managment of new/edit layer