fixing an issue with the view not being displayed in some circumstances