Refactored to prevent syntax error

After four commits (one by mine) trying to fix this is better to refactor it. Here I removed the the argument outside the function call in a variable.