fixing the is_writable check to use the acutal file