update trailing slash function to be backwards compatible with IE*