Added !global to conditional statement for text direction.