Fixed custom layout bug