fixed compatibitly issues for safari and firefox