putMainRes tweaked