remove trailing spaces
drop useless javascript code
try to fix concurrency on client side