fixed delete error, minor tweaks