refactoring
refactoring, fixed bugs with not functioning buttons on newly created items