further changes made to make modelr comaptible with dplyr 0.3