fixed all bugs in definition loading