Remove db query, and use active record instead.