there must be abetter way to handle the error