fixed bug in later versions of firefox caused by textlength of 0