fix bug with return value