value and function bug fixed!