fix for function