Move capture to Platform class
Fix typo
Fix wrong if condition