add some error check and return.