pass errors and req object