Fixed a bug in Front end's code