fixed runtime errors
done