fixed call routine bugs