Corrected its logic. If there is no record then message is shown