fixed some js errors in console