Added basic devise logic