fix expand functionality