Fix parameter
Missing class
Add extra return
Use Settings class for errmsg