fixing tail statement