removed odd file.mode check in get_data func, added loggging