added option to pass view