fixed delete after insert, also extended scheme( not used for now )