Removed unecessary allocation of space for message and scan