added posttres stuff