Pass variable when calling end function

Fix : Strict warning : Only variables should be passed by reference
The end() function is waiting for variable reference. We should pass it a variable and not function.