Added check for uninitialized variables