added beforefilter for devise.