implemented some parts of devise