adding some error paths