added some exception handling