Add if statement to check empty list