What kind of errors are you getting? Could you post the error message with the complete stack trace, please?
PS: you can post code snippets by wrapping them into three backticks ```, which makes debugging easier.