fixed constraints, implemented chat import