added UA Header and enhanced regexp
fixed some bugs