added some codes to avoide webkit bugs.