bug with return value fixed