moved if statement for no data up