Changed ! empty() to isset() because ! empty() would not give results for falsely type values