fix bug separate functions
upgrade restas commit 2886f593977dbfe1bcb2a3abff8bc37cb41803a8