Added main features in add and edit functions