updated code
fixed weird Chrome bug