Add warning log and remove redundant goto which wasn't meant to be there