Fixed security problems and devise error msg class