also for error logic, not completed.