added no data case functionality to avoid crashing or throwing the user to the main page