added more to views and moved yield back to outside the if loop