working better but still bug in behavior