handled invalidoperation exception