added error check when nothing exist