function returns working in vm