added port direction check on read
added write action and according tests