Modified the bug of reading inputs twicee