implemented the doAction function for the constant class