Add timeout and rework on some stuff