added error check poing