Updated for devise 3.1+