made some fixes to donate code