fixing error relating to protected attributes