added if statements for empty fields