ADDING CHECK TO CORNER CASES