Catch more errors, JSHint
moved to init function