cleanup and fix notice error. close issue #2