reverted changes and fixed delete