fix for return calculation