Fix note preview function