check undefined middleware