added trace messages to check for null