updated code to not need viewconfig