updated remove_delayed and added tests