fixed bug in front end js