added features, but not fully working for edit