fixed a bug (undefined note found on getClosestNote)