trying to replace in syntax to endwith