tested & fixed external procedure calling