fixed put method, moved connection to entity