Changed calling $from[0] to using reset($from)

changed usage $from[0] according suggestion from @Ocramius  to use array
reset function