Fixed the timeout which lead to the error
refactored a bit … no change on functionality
Did some formatting
WTF