fixed up inheritance problem and js