added keep_last