Update dependencies

Updated dependencies and updated code accordingly.