ends_with function must be static