Fixed headers-sent bug by adding noop middleware for * at the end.