fix runtime exceptions