Added a nil check for notes