added checks for required return statements