active record exception fix