fix bug and must be create logic class