updated to work with mew awesome and lua 5.2