Fixed bug with no data exception and crash