add func but have some problems