fixed null errors