Fixed problem with scope when calling functions