fixed replace when empty string is used