Mockdevice port fix

please review my code :)