fixed compilation after return requirement for local functions added