Added null/empty conditions