Bug fix in new function...\!