added logic client or server