Fix problem calling new_resource instead of local variables.