add error handling in shrink command