added catch for empty token