Fixes a final error due to wrong variable passing