need to fix the function..