Added missing variables and method to replace texts