bad fix for function 'branch'