fixed many bugs in old browsers