Fixed functino name function to work in IE