layout nil bug fixed