errors due to wrong variables resolved.