fixed an active record bug