Tracing throwing exception with 'res' being undefined 

A minor fix from some refactoring done a couple of days ago. The variable 'res' was not being declared or used and as a result was failing - in my case it took down the whole app so this is potentially a serious issue. My situation might be isolated however.