fixing some error issues