Fixed bug that caused infinite loop on setting a custom view