further code checks around devise