You're introducing another bug here. First and second call of the function would return different results even with no parameters - this must not happen.