Reverted to old code to test (left working one in comments)