fix a prototype inheritance bug