added exception handling in model