fixed run time errors