fix potential bugs (Unchecked return value)