enabling middleware