fixed run time erros