Add isset checks for better performance