make function static, fixes #344