added cursor, fixed delete