fix js error - static checking would be asesome