remove unfinished middleware